package artibella.utils 
{
	import flash.display.BitmapData;
	/**
	 * ...
	 * @author pbordachar
	 */
	
	public class BitmapUtils
	{
		
		public function BitmapUtils() 
		{
			
		}
		
		public static function hex2argb( coul:int ):Object
		{
			var obj:Object = new Object();
			obj.alpha = ( coul >>> 24 ) & 0xFF;
			obj.rouge = ( coul >>> 16 ) & 0xFF;
			obj.vert = ( coul >>> 8 ) & 0xFF;
			obj.bleu = coul & 0xFF;
			
			return obj;
		}
		
		public static function argb2hex( a:int, r:int, g:int, b:int  ):int
		{
			return a << 24 | r << 16 | g << 8 | b;
		}
		
		// - - -
		
		public static function hexValue( coul:int ):String
		{
			return "0x" + coul.toString( 16 ).toUpperCase();
		}
		
		public static function weight( bmd:BitmapData ):int
		{
			return ( bmd.width * bmd.height ) * 4 ;
		}
		
	}

}